const initState: {
  harvestId: string
  projectId: string
  description: string
} = {
  harvestId: '',
  projectId: '',
  description: '',
}

//  默认传参
export default function harvestInfoReducer(preState = initState, action) {
  // 从 action 对象中获取：type、data
  const { type, data } = action

  // 根据 type 决定如何加工数据
  switch (type) {
    case 'updateHarvestInfo':
      const obj = { ...preState, ...data }
      // console.log(obj)
      return obj
    default:
      return preState
  }
}
